#pragma once
#include <string>
#include "tcpclient.h"
#include "3761.h"

typedef enum{
	LOGIN_NO   = 0,
	LOGIN_SEND = 1,
	LOGIN_OK   = 2}LoginState;
class Controller : public TcpClient,public FrameMaker
{
public:
	LoginState  lstate;
	time_t		beatInterval;
protected:
	Loger		loger;
	time_t		lastrecv;
	time_t		lastsend;
	time_t		lastbeat;
	time_t		lastlog;
public:
	Controller(void);
public:
	bool sendTimeout(void);
	bool recvTimeout(void);
	bool beatTimeout(void);
	bool receive(void);
	bool sendout(void);
	bool check(void);
	bool heatbeat(void);
	bool login(void);
};
